import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import '../../common/const/cosnt.dart';

class LoginTextFieldView extends StatelessWidget {
  final List<TextInputFormatter>? inputFormatters;
  final TextInputType? inputType;
  final TextEditingController? controller;
  final FocusNode? focusNode;
  final String? hitText;
  final Color bgColor;
  final bool isobser;
  final int? maxlength;
  final Function(String sender)? onChanged;

  const LoginTextFieldView(
      {Key? key,
      this.inputFormatters,
      this.onChanged,
      this.maxlength,
      this.isobser = false,
      this.hitText,
      this.inputType,
      this.controller,
      this.focusNode,
      this.bgColor = AppColor.divigrey})
      : super(key: key);
  @override
  Widget build(BuildContext context) {
    return PhysicalModel(
      color: Colors.white,
      clipBehavior: Clip.antiAlias,
      borderRadius: BorderRadius.circular(3),
      child: TextField(
        inputFormatters: inputFormatters,
        keyboardType: inputType,
        controller: controller,
        focusNode: focusNode,
        maxLength: maxlength,
        obscureText: isobser,
        onChanged: onChanged,
        onSubmitted: onChanged,
        decoration: InputDecoration(
            border: InputBorder.none,
            hintText: hitText,
            filled: true,
            fillColor: bgColor,
            counterText: "",
            contentPadding: const EdgeInsets.symmetric(horizontal: 10)),
      ),
    );
  }
}
